package com.stlm2.dems.user.entity;

/**
 * Created by Administrator on 2017/5/23.
 */
public enum UserType {
    Normal(1) {
        public String toString() {
            return "普通用户";
        }
    },
    Merchant(2) {
        public String toString() {
            return "商户";
        }
    },
    Salesman(3) {
        public String toString() {
            return "业务员";
        }
    },
    Director(4) {
        public String toString() {
            return "后台人员";
        }
    },
    ChildMerchant(5) {
        public String toString() {
            return "子商户";
        }
    },
    Agency(6) {
        public String toString() {
            return "代理";
        }
    },
    Finance(7) {
        public String toString() {
            return "代理财务";
        }
    },
    Admin(15) {
        public String toString() {
            return "管理员";
        }
    };

    private final int val;

    UserType(int n) {
        val = n;
    }

    public int getIntValue() {
        return val;
    }

    public static UserType getByIntValue(int n) {
        switch (n) {
            case 1:
                return Normal;
            case 2:
                return Merchant;
            case 3:
                return Salesman;
            case 4:
                return Director;
            case 5:
                return ChildMerchant;
            case 6:
                return Agency;
            case 7:
                return Finance;
            case 15:
                return Admin;
            default:
                return null;
        }
    }
}
